<template>
	<view>
		<image :src="alarmImageUrl" style="width: 100vw;height: 100vh;"></image>
		<!-- <view class="bottomV" @click="saveImage">保存</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				alarmImageUrl:'',
			}
		},
		onLoad(opt) {
			let enData = JSON.parse(decodeURIComponent(opt.alarmImageUrl))
			this.alarmImageUrl = enData.alarmImageUrl
		},
		methods: {
			//保存
			saveImage(){
				console.log('保存图片');
				uni.downloadFile({
					url:this.alarmImageUrl,
					success: (response) => {
						console.log('response',response);
						uni.saveImageToPhotosAlbum({
							filePath: response.tempFilePath,
							success: (res)=> {
								console.log('save success',res);
								uni.showToast({
									title:'保存成功',
									icon:'none'
								})
							},
							fail: (err) => {
								console.log('save fail',err);
								uni.showToast({
									title:'保存失败',
									icon:'none'
								})
							}
						})
					},
					fail: (error) => {
						console.log('error==',error);
					}
				})
			}
		}
	}
</script>

<style>
	
.bottomV{
	position: fixed;
	left: 30rpx;
	right: 30rpx;
	bottom: 150rpx;
	height: 80rpx;
	border: 1px solid white;
	border-radius: 10rpx;
	color: #FF0025;
	align-items: center;
	justify-content: center;
	display: flex;
}
</style>
